package sng.modules.view.components.city.state
{
	import flashx.textLayout.events.UpdateCompleteEvent;
	
	import mx.controls.Alert;
	import mx.events.CloseEvent;
	
	import sng.modules.view.components.city.cursor.CityCursor;
	import sng.modules.view.components.city.cursor.CityCursorManager;
	import sng.modules.view.components.city.logic.City;
	import sng.modules.view.components.city.logic.unit.BaseBuilding;

	
	/**
	 * 
	 * @author leonliu
	 * 拆除状态
	 * 
	 */	
	public class CityDeleteState implements ICityState
	{
		public function CityDeleteState(_city:City)
		{
			city=_city;
				
			//更改指针状态 eason 20110714
			CityCursorManager.getInstance().setCursor(CityCursor.DELETE_CURSOR);
		}
		public var city:City;
		public function Execute(parameter:*=null):void
		{
			//1.删除操作
			Alert.show("确认售出该建筑吗？", "", Alert.YES|Alert.NO, null, alertClickHandler);
			function alertClickHandler(evt:CloseEvent):void {
				if (evt.detail == Alert.YES) {
					city.currentBuilding.dispose();
				}
			}	

			//2.其它业务逻辑
		}
		
		public function toString():String
		{
			return "CityDeleteState";
		}
	}
}